bitkeeper revision 1.1159.174.3 (4199eadf9ra8mQPwvvr9Ke8eQfkfIg)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Tue, 16 Nov 2004 11:56:15 +0000 (11:56 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Tue, 16 Nov 2004 11:56:15 +0000 (11:56 +0000)
Fix CONFIG_DEBUG_PAGEALLOC. More generally, this fixes
__change_page_attr at the same time (incompatible with writable
pagetables).

linux-2.6.9-xen-sparse/arch/xen/i386/mm/pageattr.c
linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h

index 19f9d9c525a5ef4bd6b1cfa75fd4c6cf0980dbee..74f3b150df1c871410dbe8f739f8216b95c4ff4d 100644 (file)
@@ -119,7 +119,7 @@ __change_page_attr(struct page *page, pgprot_t prot)
                if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
                        pte_t old = *kpte;
                        pte_t standard = mk_pte(page, PAGE_KERNEL); 
-                       set_pte_atomic(kpte, mk_pte(page, prot)); 
+                       set_pte_batched(kpte, mk_pte(page, prot)); 
                        if (pte_same(old,standard))
                                get_page(kpte_page);
                } else {
@@ -130,7 +130,7 @@ __change_page_attr(struct page *page, pgprot_t prot)
                        set_pmd_pte(kpte,address,mk_pte(split, PAGE_KERNEL));
                }       
        } else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
-               set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
+               set_pte_batched(kpte, mk_pte(page, PAGE_KERNEL));
                __put_page(kpte_page);
        }
 
@@ -171,6 +171,7 @@ int change_page_attr(struct page *page, int numpages, pgprot_t prot)
                if (err) 
                        break; 
        }       
+       flush_page_update_queue();
        spin_unlock_irqrestore(&cpa_lock, flags);
        return err;
 }
index aa23bd9d55b2f06badb1eef6b00f0a29c13685b6..7000c5dbe88be95bce03c23d330744376179328c 100644 (file)
@@ -23,13 +23,10 @@ static inline int pgd_present(pgd_t pgd)    { return 1; }
  * within a page table are directly modified.  Thus, the following
  * hook is made available.
  */
-#ifdef CONFIG_XEN_WRITABLE_PAGETABLES
+#define set_pte_batched(pteptr, pteval) \
+queue_l1_entry_update(pteptr, (pteval).pte_low)
 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
-#define set_pte_atomic(pteptr, pteval) (*(pteptr) = pteval)
-#else
-#define set_pte(pteptr, pteval) xen_l1_entry_update(pteptr, (pteval).pte_low)
-#define set_pte_atomic(pteptr, pteval) xen_l1_entry_update(pteptr, (pteval).pte_low)
-#endif
+#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
 /*
  * (pmds are folded into pgds so this doesn't get actually called,
  * but the define is needed for a generic inline function.)